const mongoose = require('mongoose')
const Schema = mongoose.Schema
const baseModel = require('./baseModel')

const { String, ObjectId } = mongoose.Schema.Types

const msgSchema = new Schema({
  ...baseModel,
  msg: {
    type: String,
    required: true,
  },
  senderId: {
    type: ObjectId,
    ref: 'User',
    required: true,
  },
  receiverId: {
    type: ObjectId,
    ref: 'User',
    required: true,
  },
})

module.exports = msgSchema
